<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__ADMIN__css/style.css"  media="all">
  <link rel="stylesheet" href="__ADMIN__layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div class="pad-20">
<fieldset class="layui-elem-field layui-field-title">
<legend>留言管理</legend>
</fieldset>
<form name="myform" id="myform" action="" method="post">
<div class="layui-form">
  <table class="layui-table">
    <colgroup>
      <col>
      <col width="200">
      <col width="150">
      <col width="150">
      <col width="150">
      <col width="200">
    </colgroup>
    <thead>
      <tr>
        <th>姓名/公司名称</th>
        <th>版位</th>
        <th>联系方式</th>
        <th>电子邮箱</th>
        <th>留言时间</th>
        <th>管理操作</th>
      </tr>
    </thead>
    <tbody>
    <volist name="lists" id="val">
      <tr>
        <td>{$val['company_title']}</td>
        <td>{:get_row('留言',$val['catid'],'title')}</td>
        <td>{$val['company_mobile']}</td>
        <td>{$val['company_email']}</td>
        <td>{:date('Y-m-d',$val['create_time'])}</td>
        <td>
            <a class="layui-btn layui-btn-mini" href="{:U('edit',array('id'=>$val['id']))}"><i class="layui-icon">&#xe61d;</i>查看</a>
            <a class="layui-btn layui-btn-danger layui-btn-mini action_del" data-id={$val['id']}><i class="layui-icon">&#xe640;</i>删除</a>
        </td>
      </tr>
    </volist>
    </tbody>
  </table>
</div>
</form>
</div>
<div class="yzui-filler"></div>
<script src="__ADMIN__js/jquery-1.9.1.min.js" charset="utf-8"></script>
<script src="__ADMIN__layui/layui.js" charset="utf-8"></script>
<script>
  layui.use('form', function(){
    var $ = layui.jquery, form = layui.form();
  });
  $(".action_del").click(function(){
    var _this = $(this);
    layer.confirm('确定删除此信息？',{icon:3, title:'提示信息'},function(index){
      var dataid = _this.attr("data-id");
      $.post("{:U('del')}",{id:dataid},function(result){
        if(result == 1){
          _this.parents("tr").remove();
          layer.close(index);
        }else{
          layer.alert('服务器正忙，请稍后再试');
        }
      });
    });
  });
</script>
</body>
</html>
